package toponet.geometry;

public class Orientation {
	public static boolean isCounterClockwise(double x0, double y0, double x1, double y1, double x2, double y2) {
		double m[][] = new double[3][3];
		m[0][0] = 1; m[1][0] = x0; m[2][0] = y0;
		m[0][1] = 1; m[1][1] = x1; m[2][1] = y1;
		m[0][2] = 1; m[1][2] = x2; m[2][2] = y2;
		double value = m[0][0]*m[1][1]*m[2][2]-m[0][2]*m[1][1]*m[2][0]+
						+m[0][1]*m[1][2]*m[2][0]-m[0][1]*m[1][0]*m[2][2]+
						+m[0][2]*m[1][0]*m[2][1]-m[0][0]*m[1][2]*m[2][1];
		if(value>=0)
			return true;
		return false;
	}
}
